<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .main {
      width: 400px;
      height: 200px;
      background-color: pink;
    }

    .search {
      display: inline-block;
      width: 250px;
      height: 50px;
      background-color: purple;
      vertical-align: middle;
    }

    .main::after {
      content: "";
      display: inline-block;
      height: 100%;
      vertical-align: middle;
    }
  </style>
</head>

<body>
  <div class="main">
    <div class="search"></div>
  </div>
</body>

</html>